package com.wc.alorithm_blue_bridge._日期问题.跑步计划;

/**
 * @Author congge
 * @Date 2024/5/22 17:42
 * @description https://www.lanqiao.cn/problems/17113/learning/?problem_list_id=32&page=1
 */
public class Main {

    static int[] ms = new int[]{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    public static void main(String[] args) {
        int sum = 0;
        int wek = 7;
        int res = 0;
        for (int m = 1; m <= 12; m++) {
            for (int d = 1; d <= ms[m]; d++) {
                if (wek == 1 || containsOne(m) || containsOne(d)) {
                    res += 5;
                } else res += 1;
                wek++;
                if (wek == 8) wek = 1;
            }
        }
        System.out.println(res);
    }

    static boolean containsOne(int x) {
        while (x > 0) {
            if (x % 10 == 1) return true;
            x /= 10;
        }
        return false;
    }
}

